package com.opencloud.tenant.server.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.opencloud.common.mybatis.base.service.impl.BaseServiceImpl;
import com.opencloud.tenant.server.mapper.AdminAccountMapper;
import com.opencloud.tenant.server.service.AdminAccountService;
import com.opencloud.tenant.client.model.entity.AdminAccount;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 登录账号 服务实现类
 *
 * @author admin
 * @date 2021-03-13
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class AdminAccountServiceImpl extends BaseServiceImpl<AdminAccountMapper, AdminAccount> implements AdminAccountService {

    @Autowired
    private AdminAccountMapper adminAccountMapper;
    @Override
    public AdminAccount getAccount(String account, String accountType) {
        QueryWrapper<AdminAccount> queryWrapper = new QueryWrapper();
        queryWrapper.lambda()
                .eq(AdminAccount::getAccount, account)
                .eq(AdminAccount::getAccountType, accountType);
        return adminAccountMapper.selectOne(queryWrapper);
    }


}
